#include "Globals.h"


CTimer *GL_timer = NULL;
CGraphic *GL_graphic = NULL;

int GL_scrWidth = 800;
int GL_scrHeight = 600;
int GL_mode;
bool GL_windowMode = false;
int GL_frameRate;
TCHAR	GL_AppName[] = "MARIO OLALA";
float	GL_DeltaTime = 0;
int GL_FPS = 0;

void GLLogger(char* format, ...)
{	
	char *_logFile = "D:\\Game.log";
	int _logNum = 1;

	if (!_logNum) return;

	FILE *f = stderr;
	if (_logFile!=NULL)
	{
		if (fopen_s(&f, _logFile,"a")!=0) 
		{
			fprintf(stderr,"WARNING: Failed to open trace file '%s' for writing!\n", _logFile);
			return;
		}
	}
	va_list ap;
	va_start(ap, format);
	fprintf(f, format, ap);
	va_end(ap);
	fprintf(f,"\n");
	if (_logFile != NULL) fclose(f);
}

void GLMessage(char* text)
{
	MessageBox(GL_graphic->GethWindow(), text, "Mario Voice", MB_OK);
}

void GLTitle(char* text){
	SetWindowText(GL_graphic->GethWindow(), text);
}
